{# 引入自定义过滤器文件 #}
{% load filter01 %}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>goods-info</title>
    <style>
        table,th,td{
            border: 1px solid #000;
            text-align: center;
        }
    </style>
</head>
<body>
    {# 商品信息展示表格 #}
    <table cellspacing="0" cellpadding="10">
        <tr>
            <th>序号</th>
            <th>编号</th>
            <th>商品名称</th>
            <th>单价</th>
            <th>生产日期</th>
        </tr>
        {# for循环展示数据 #}
        {% for goods in data %}
        <tr>
            <td>{{ forloop.counter }}</td>
            <td>{{ goods.id }}</td>
            <td>{{ goods.name }}</td>
            <td>{{ goods.price | re_price}}</td>
            <td>{{ goods.time | date:"Y/m/d"}}</td>
        </tr>
        {% endfor %}
    </table>
    {# length过滤器 获取长度 #}
    <p>商品数：{{data | length}}</p>
</body>
</html>